gdk_set_pointer_hooks
gdk_set_program_class
gdk_set_show_events
-gdk_set_sm_client_id
gdk_setting_action_get_type G_GNUC_CONST
gdk_setting_get
gdk_spawn_command_line_on_screen
gdk_x11_screen_get_xscreen
gdk_x11_screen_lookup_visual
gdk_x11_screen_supports_net_wm_hint
+gdk_x11_set_sm_client_id
gdk_x11_ungrab_server
gdk_x11_visual_get_xvisual
gdk_x11_window_get_xid
static guint signals[LAST_SIGNAL] = { 0 };
-static char *gdk_sm_client_id;
-
static const GdkDisplayDeviceHooks default_device_hooks = {
_gdk_windowing_get_device_state,
gdk_window_real_window_get_device_position,
gdk_screen_broadcast_client_message (gdk_screen_get_default (), event);
}
-/**
- * gdk_set_sm_client_id:
- * @sm_client_id: the client id assigned by the session manager when the
- * connection was opened, or %NULL to remove the property.
- *
- * Sets the <literal>SM_CLIENT_ID</literal> property on the application's leader window so that
- * the window manager can save the application's state using the X11R6 ICCCM
- * session management protocol.
- *
- * See the X Session Management Library documentation for more information on
- * session management and the Inter-Client Communication Conventions Manual
- * (ICCCM) for information on the <literal>WM_CLIENT_LEADER</literal> property.
- * (Both documents are part of the X Window System distribution.)
- **/
-void
-gdk_set_sm_client_id (const gchar* sm_client_id)
-{
- GSList *displays, *tmp_list;
-
- g_free (gdk_sm_client_id);
- gdk_sm_client_id = g_strdup (sm_client_id);
-
- displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
- for (tmp_list = displays; tmp_list; tmp_list = tmp_list->next)
- _gdk_windowing_display_set_sm_client_id (tmp_list->data, sm_client_id);
-
- g_slist_free (displays);
-}
-
-/**
- * _gdk_get_sm_client_id:
- *
- * Gets the client ID set with gdk_set_sm_client_id(), if any.
- *
- * Return value: Session ID, or %NULL if gdk_set_sm_client_id()
- * has never been called.
- **/
-const char *
-_gdk_get_sm_client_id (void)
-{
- return gdk_sm_client_id;
-}
-
void
_gdk_display_enable_motion_hints (GdkDisplay *display,
GdkDevice *device)
"_NET_VIRTUAL_ROOTS"
};
+static char *gdk_sm_client_id;
+
G_DEFINE_TYPE_WITH_CODE (GdkDisplayX11, _gdk_display_x11, GDK_TYPE_DISPLAY,
G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR,
gdk_display_x11_event_translator_init))
g_list_free (list);
}
+static void
+set_sm_client_id (GdkDisplay *display,
+ const gchar *sm_client_id)
+{
+ GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
+
+ if (gdk_display_is_closed (display))
+ return;
+
+ if (sm_client_id && strcmp (sm_client_id, ""))
+ XChangeProperty (display_x11->xdisplay, display_x11->leader_window,
+ gdk_x11_get_xatom_by_name_for_display (display, "SM_CLIENT_ID"),
+ XA_STRING, 8, PropModeReplace, (guchar *)sm_client_id,
+ strlen (sm_client_id));
+ else
+ XDeleteProperty (display_x11->xdisplay, display_x11->leader_window,
+ gdk_x11_get_xatom_by_name_for_display (display, "SM_CLIENT_ID"));
+}
+
/**
* gdk_display_open:
* @display_name: the name of the display to open
GdkWindowAttr attr;
gint argc;
gchar *argv[1];
- const char *sm_client_id;
-
+
XClassHint *class_hint;
gulong pid;
gint i;
class_hint);
XFree (class_hint);
- sm_client_id = _gdk_get_sm_client_id ();
- if (sm_client_id)
- _gdk_windowing_display_set_sm_client_id (display, sm_client_id);
+ if (gdk_sm_client_id)
+ set_sm_client_id (display, gdk_sm_client_id);
pid = getpid ();
XChangeProperty (display_x11->xdisplay,
GdkDragProtocol *protocol,
guint *version);
+
+/**
+ * gdk_x11_set_sm_client_id:
+ * @sm_client_id: the client id assigned by the session manager when the
+ * connection was opened, or %NULL to remove the property.
+ *
+ * Sets the <literal>SM_CLIENT_ID</literal> property on the application's leader window so that
+ * the window manager can save the application's state using the X11R6 ICCCM
+ * session management protocol.
+ *
+ * See the X Session Management Library documentation for more information on
+ * session management and the Inter-Client Communication Conventions Manual
+ */
+void
+gdk_x11_set_sm_client_id (const gchar *sm_client_id)
+{
+ GSList *displays, *l;
+
+ g_free (gdk_sm_client_id);
+ gdk_sm_client_id = g_strdup (sm_client_id);
+
+ displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
+ for (l = displays; l; l = l->next)
+ set_sm_client_id (l->data, sm_client_id);
+
+ g_slist_free (displays);
+}
+
static void
_gdk_display_x11_class_init (GdkDisplayX11Class * class)
{
#include <X11/XKBlib.h>
#endif
-
typedef struct _GdkPredicate GdkPredicate;
typedef struct _GdkGlobalErrorTrap GdkGlobalErrorTrap;
g_list_free (devices);
}
-void
-_gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
- const gchar *sm_client_id)
-{
- GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
-
- if (gdk_display_is_closed (display))
- return;
-
- if (sm_client_id && strcmp (sm_client_id, ""))
- {
- XChangeProperty (display_x11->xdisplay, display_x11->leader_window,
- gdk_x11_get_xatom_by_name_for_display (display, "SM_CLIENT_ID"),
- XA_STRING, 8, PropModeReplace, (guchar *)sm_client_id,
- strlen (sm_client_id));
- }
- else
- XDeleteProperty (display_x11->xdisplay, display_x11->leader_window,
- gdk_x11_get_xatom_by_name_for_display (display, "SM_CLIENT_ID"));
-}
-
/*
*--------------------------------------------------------------
* gdk_x_io_error
gint n_events);
+void gdk_x11_set_sm_client_id (const gchar *sm_client_id);
+
G_END_DECLS
#endif /* __GDK_X_H__ */